package sougou;

public class two {
    public static void main(String[] args) {
        char a = '2';
        char b = '0';
        System.out.println(a + b);
    }

    public int getHouses(int t, int[] xa) {
        // write code here
        int num = 2;
        int[] arr = new int[xa.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = xa[i] - xa[i + 1] / 2;
            arr[i + 1] = xa[i] + xa[i + 1] / 2;
        }
        for (int i = 1; i <= arr.length && i + 2 <= arr.length; i += 2) {
            if (Math.abs(arr[i + 1]) - arr[i] == t) {
                num++;
            } else if (Math.abs(arr[i + 1]) - arr[i] > t){
                num += 2;
            }
        }
        return num;
    }
}
